import request from "@/utils/request.js"

export default{

  findById(id){
    return request({
      url:`/productUnit/${id}`,
      method:'get'
    });
  },
  findAll(page,size){
    return request({
      url:`/productUnit/${page}/${size}`,
      method:'get'
    });
  },
  findAllUnit(){
    return request({
      url:`/productUnit/`,
      method:'get'
    });
  },
  deleteById(id){
    return request({
      url:`/productUnit/${id}`,
      method:'delete'
    });
  },
  save(productUnit){
    return request({
      url:`/productUnit`,
      method:'post',
      data:productUnit
    });
  },
  update(id,productUnit){
    if(id==''){
      return this.save(productUnit)
    }
    return request({
      url:`/productUnit/${id}`,
      method:'put',
      data:productUnit
    });
  },
  search(searchMap,page,size){
    return request({
      rtl:`/productUnit/search/${page}/${size}`,
      method:'post',
      data:searchMap
    });
  }
}
